home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1997
/
HAM Radio 1997.iso
/
vcls
/
real3d-2.000
/
real.mst
< prev
next >
Wrap
Text File
|
1996-04-08
|
11KB
|
265 lines
'**************************************************************************
'* MSSetup Toolkit Sample 1
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST APPHELP = 900
CONST BADPATH = 6400
''Bitmap ID
CONST LOGO = 1
GLOBAL DEST$ ''Default destination directory.
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "Real 3D Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "REAL.INF"
END IF
ReadInfFile szInf$
OPTCUR$ = "1"
DEST$ = "C:\REAL"
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
WinDrive$ = MID$(GetWindowsDir, 1, 1)
IF IsDriveValid(WinDrive$) = 0 THEN
i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONEXCLAMATION+MB_OK)
GOTO QUIT
END IF
'$ENDIF ''DEBUG
WELCOME:
sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
UIPop 1
ELSE
GOSUB ASKQUIT
GOTO WELCOME
END IF
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
DEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO GETPATH
ELSE
GOSUB ASKQUIT
GOTO GETPATH
END IF
Install
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
CreateDir DEST$ + "\PROJECTS", cmoNone
CreateDir DEST$ + "\OBJECTS", cmoNone
CreateDir DEST$ + "\ENV", cmoNone
CreateDir DEST$ + "\MACROS", cmoNone
CreateDir DEST$ + "\IMAGES", cmoNone
CreateDir DEST$ + "\MATPREV", cmoNone
CreateDir DEST$ + "\TEXTURES", cmoNone
CreateDir DEST$ + "\BUMPMAPS", cmoNone
CreateDir DEST$ + "\BUMPMAPS\WAVESEQ", cmoNone
CreateDir DEST$ + "\MATERIAL", cmoNone
CreateDir DEST$ + "\ANIM", cmoNone
CreateDir DEST$ + "\COLORS", cmoNone
CreateDir DEST$ + "\RPL", cmoNone
CreateDir DEST$ + "\TUBEFONT", cmoNone
CreateDir DEST$ + "\REALFONT", cmoNone
CreateDir DEST$ + "\EXAMPLES", cmoNone
CreateDir DEST$ + "\EXAMPLES\ANIM", cmoNone
CreateDir DEST$ + "\EXAMPLES\BOOLEAN", cmoNone
CreateDir DEST$ + "\EXAMPLES\FREEFORM", cmoNone
CreateDir DEST$ + "\DELTA", cmoNone
AddSectionFilesToCopyList "Executables", SrcDir$, DEST$
CopyFilesInCopyList
i% = DoMsgBox("Please insert Real 3D Disk 3 in drive", "Change Disk", MB_TASKMODAL+MB_ICONEXCLAMATION+MB_OK)
AddSectionFilesToCopyList "Exec2", SrcDir$, DEST$
AddSectionFilesToCopyList "Macros", SrcDir$, DEST$ + "\macros"
AddSectionFilesToCopyList "Rpl", SrcDir$, DEST$ + "\rpl"
AddSectionFilesToCopyList "Sys", SrcDir$, DEST$ + "\rpl\sys"
AddSectionFilesToCopyList "Textures", SrcDir$, DEST$ + "\textures"
AddSectionFilesToCopyList "Bumpmaps", SrcDir$, DEST$ + "\bumpmaps"
AddSectionFilesToCopyList "Waveseq", SrcDir$, DEST$ + "\bumpmaps\waveseq"
AddSectionFilesToCopyList "Objects", SrcDir$, DEST$ + "\objects"
AddSectionFilesToCopyList "MatPrev", SrcDir$, DEST$ + "\matprev"
AddSectionFilesToCopyList "Projects", SrcDir$, DEST$ + "\projects"
AddSectionFilesToCopyList "Tubefont", SrcDir$, DEST$ + "\tubefont"
AddSectionFilesToCopyList "Startup", SrcDir$, DEST$
AddSectionFilesToCopyList "Boolean", SrcDir$, DEST$ + "\examples\boolean"
AddSectionFilesToCopyList "Freeform", SrcDir$, DEST$ + "\examples\freeform"
' AddSectionFilesToCopyList "Animexmp", SrcDir$, DEST$ + "\examples\animatio"
' AddSectionFilesToCopyList "Images", SrcDir$, DEST$ + "\images"
CopyFilesInCopyList
i% = DoMsgBox("Please insert Real 3D Disk 4 in drive", "Change Disk", MB_TASKMODAL+MB_ICONEXCLAMATION+MB_OK)
AddSectionFilesToCopyList "Help", SrcDir$, DEST$
AddSectionFilesToCopyList "Realfont", SrcDir$, DEST$ + "\realfont"
AddSectionFilesToCopyList "Delta", SrcDir$, DEST$ + "\delta"
AddSectionFilesToCopyList "Anim", SrcDir$, DEST$ + "\examples\anim"
CopyFilesInCopyList
i% = DoMsgBox("Please insert Real 3D Disk 5 in drive", "Change Disk", MB_TASKMODAL+MB_ICONEXCLAMATION+MB_OK)
AddSectionFilesToCopyList "Images", SrcDir$, DEST$ + "\images"
CopyFilesInCopyList
ini$ = MakePath(DEST$, "REAL.INI")
ini$ = MakePath(GetWindowsDir, "REAL.INI")
CreateIniKeyValue ini$, "Paths", "Projects", DEST$ + "\PROJECTS", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "Objects", DEST$ + "\OBJECTS", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "Environment", DEST$ + "\ENV", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "Macros", DEST$ + "\MACROS", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "Images", DEST$ + "\IMAGES", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "Textures", DEST$ + "\TEXTURES", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "Materials", DEST$ + "\MATERIAL", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "Animations", DEST$ + "\ANIM", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "Colors", DEST$ + "\COLORS", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "Rpl", DEST$ + "\RPL", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "RplPaths", DEST$ + "\RPL;" + DEST$ + "\MACROS", cmoOverwrite
CreateIniKeyValue ini$, "Paths", "TexturesPaths", DEST$ + "\TEXTURES;" + DEST$ + "\BUMPMAPS;" + DEST$ + "\MATPREV", cmoOverwrite
CreateIniKeyValue ini$, "Fonts", "Normal", "-17,0,0,0,400,0,0,0,0,3,2,1,34,Arial", cmoNone
CreateIniKeyValue ini$, "Fonts", "Italic", "-17,0,0,0,400,255,0,0,0,3,2,1,34,Arial", cmoNone
CreateIniKeyValue ini$, "Fonts", "Bold", "-17,0,0,0,700,0,0,0,0,3,2,1,34,Arial", cmoNone
CreateIniKeyValue ini$, "Fonts", "BoldItalic", "-17,0,0,0,700,255,0,0,0,3,2,1,34,Arial", cmoNone
CreateProgmanGroup "Real 3D Demo", "", cmoNone
ShowProgmanGroup "Real 3D Demo", 1, cmoNone
CreateProgmanItem "Real 3D Demo", "Real 3D", MakePath(DEST$,"REALDEMO.EXE") + " ", "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Ballbear", MakePath(DEST$,"REALDEMO.EXE") + " projects\ballbear.prj", "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Dice", MakePath(DEST$,"REALDEMO.EXE") + " projects\dice.prj", "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Girl", MakePath(DEST$,"REALDEMO.EXE") + " projects\girl.prj", "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Glass", MakePath(DEST$,"REALDEMO.EXE") + " projects\glass.prj", "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Simple", MakePath(DEST$,"REALDEMO.EXE") + " projects\simple.prj", "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Girl Obj", MakePath(DEST$,"REALDEMO.EXE") + " objects\girl.obj", "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Head Obj", MakePath(DEST$,"REALDEMO.EXE") + " objects\head1.obj", "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Head&Hat Obj", MakePath(DEST$,"REALDEMO.EXE") + " objects\head_hat.obj", "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "ShowImg", MakePath(DEST$,"SHOWIMG.EXE"), "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Picture Show", MakePath(DEST$,"SHOWIMG.EXE") + " /d5 /s " + MakePath(DEST$, "images\*.bmp"), "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Delta Play", MakePath(DEST$,"DELTA\DPLAY.EXE"), "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Walk Delta", MakePath(DEST$,"DELTA\DPLAY.EXE") + " " + MakePath(DEST$, "delta\walk2.dlt"), "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "Run Delta", MakePath(DEST$,"DELTA\DPLAY.EXE") + " " + MakePath(DEST$, "delta\run.dlt"), "", cmoOverwrite
CreateProgmanItem "Real 3D Demo", "ReadMe", "notepad "+MakePath(DEST$,"readme.txt"), "", cmoOverwrite
END SUB
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION